//
//  GroupModel.m
//  QQGroup
//
//  Created by cocoazxj@163.com on 15/3/31.
//  Copyright (c) 2015年 handcool. All rights reserved.
//

#import "GroupModel.h"
#import "FriendsModel.h"

@implementation GroupModel

- (instancetype)initWithDict:(NSDictionary *)dict
{
    if(self = [super init])
    {
        self.name = dict[@"name"];
        self.online = [dict[@"online"] intValue];
        self.friends = dict[@"friends"];
//        self.open = NO;
        NSMutableArray *m = [NSMutableArray array];
        for(NSDictionary *d in self.friends)
        {
            [m addObject:[FriendsModel friendsModel:d]];
        }
        self.count = m.count;
        self.friends = m;
    }
    return self;
}

+ (instancetype)groupModel:(NSDictionary *)dict
{
    return [[self alloc] initWithDict:dict];
}
@end
